<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>动态菜单示例</title>
    <script src="../../library/layui/layui.js"></script>
    <link rel="stylesheet" href="../../library/layui/css/layui.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui/lib/theme-chalk/index.css">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="newMeu.js" defer></script><!-- 使用 defer 确保在 DOM 加载后执行 -->
</head>
<style>
        /* 确保 el-container 和 el-aside 有高度 */
        #app{
            height: 100%;
        }
        html, body {
            height: 100%;
            margin: 0;
        }
        .el-container {
            height: 100%;
        }
        .el-aside {
            background-color: #545c64; /* 设置背景颜色以便观察 */
        }
        .el-menu-all {
            width: 100%;
            height: 100%; /* 确保菜单高度为100% */
        }
        .el-main{
            background-color: #01aaed;
            margin: 0;
            padding:0;
        }
        .content-frame {
            width: 100%;
            height: calc(100% - 64px); /* 减去 header 的高度 */
            border: none; /* 去掉边框 */
            margin: 0;
            padding:0;
        }
</style>
<body>
<div id="app">

    <el-container>
        <el-header>Header</el-header>

        <el-container>
            <el-aside width="200px">
                <!--菜单标签-->
                <el-menu
                        default-active="2"
                        class="el-menu-vertical-demo"
                        @open="handleOpen"
                        @close="handleClose"
                        background-color="#545c64"
                        text-color="#fff"
                        active-text-color="#ffd04b">

                    <template v-for="item in menuData">
                        <el-submenu v-if="item.children.length > 0" :key="item.meuId" :index="item.meuId.toString()">
                            <template slot="title">
                                <i class="el-icon-location"></i>
                                <span>{{ item.meuName }}</span>
                            </template>
                            <el-menu-item-group>
                                <template v-for="child in item.children">
                                    <el-menu-item :key="child.meuId" :index="child.meuId.toString()">{{ child.meuName }}</el-menu-item>
                                </template>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-menu-item v-else :key="item.meuId" :index="item.meuId.toString()">
                            <i class="el-icon-menu"></i>
                            <span>{{ item.meuName }}</span>
                        </el-menu-item>
                    </template>
                </el-menu>
            </el-aside>

            <!-- 主内容 -->
            <el-main>
<!--                <el-divider content-position="left">少年包青天</el-divider>-->
                <iframe class="content-frame" :src="curPage"></iframe>
            </el-main>
        </el-container>

    </el-container>



</div>
</body>
